#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 1e6 + 10, INF = 0x3f3f3f3f;

ll n, sx, sy, ex, ey;
ll a[N], sum, dist, mx;

void yes() { cout << "Yes\n"; }
void no() { cout << "No\n"; }

void solve()
{
    sum = mx = 0;
    cin >> n >> sx >> sy >> ex >> ey;
    // 使用整数运算避免浮点精度问题
    ll dx = sx - ex, dy = sy - ey;
    dist = dx * dx + dy * dy;  // 替换pow()

    for (ll i = 1; i <= n; i++) {
        cin >> a[i];
        sum += a[i];
        mx = max(mx, a[i]);
    }

    if (n == 1) {
        if (sum * sum == dist) yes();
        else no();
    } else {
        // 先检查上限：移动距离不可能超过总能量
        if (sum * sum < dist) {
            no();
            return;
        }

        // 最大电池能量不超过总能量一半（可任意调整方向）
        if (2 * mx <= sum) {
            yes();
        }
        // 最大电池能量过大
        else {
            ll minDist = 2 * mx - sum;  // 最小必要移动距离
            if (minDist * minDist <= dist) {
                yes();
            } else {
                no();
            }
        }
    }
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    cin >> T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}